<template>
  <el-dialog
    :visible.sync="visible"
    :fullscreen="fullscreen"
    :custom-class="!fullscreen ? 'custom-height': 'custom-fullscreen'"
    :close-on-click-modal="false"
    :show-close="false"
    @closed="close"
  >
    <el-row slot="title" type="flex">
      <el-col :span="20">{{ title }}</el-col>
      <el-col :span="4" style="text-align: right">
        <svg-icon
          :icon-class="!fullscreen ? 'fullscreen': 'exit-fullscreen'"
          style="cursor: pointer; margin-right: 10px"
          @click="() => {fullscreen = !fullscreen}"
        />
        <i class="el-icon-close" style="cursor: pointer" @click="close" />
      </el-col>
    </el-row>
    <el-form label-position="left" inline class="detail-item-container">
      <el-row :gutter="18">
        <el-col :span="24">
          <el-form-item label="零件图号">
            <span>{{ model.partDrawingNumber }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="任务编号">
            <span>{{ model.taskNum }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="任务名称">
            <span>{{ model.taskName }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="任务数量">
            <span>{{ model.quantity }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="毛坯">
            <span>{{ model.blank }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="计划编号">
            <span>{{ model.planNum }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="开始时间">
            <span>{{ model.startTime }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="结束时间">
            <span>{{ model.endTime }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="创建时间">
            <span>{{ model.createTime }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="图纸" style="width: 100%; overflow-x: auto;">
            <viewer v-if="model.picNum" :images="(model.picNum || '').split(',')">
              <img
                v-for="(src,index) in (model.picNum || '').split(',')"
                :key="index"
                class="viewer-img"
                :src="`${baseURL}/${src}/image`"
              >
            </viewer>
            <span v-else />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="close">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import detail from '@/components/diboot/mixins/detail'
import { baseURL } from '@/utils/request'
export default {
  name: 'ProductTaskDetail',
  mixins: [detail],
  data() {
    return {
      baseApi: '/productTask',
      baseURL
    }
  },
  methods: {
    onAfterOpen() {
      // 事件处理代码
    },
    afterOpen() {
      this.onAfterOpen()
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
